import { createI18n, I18nOptions } from "vue-i18n";
import zh from "./zh";
import en from "./en";

const i18nOptions: I18nOptions = {
  locale: localStorage.getItem("lang") || "en",
  legacy: false,
  globalInjection: true,
  messages: {
    zh: {
      ...zh,
    },
    en: {
      ...en,
    },
  }
};

const i18n = createI18n(i18nOptions);

export { i18n };